fix: guard against nil ContextEvaluator func in memprovider Resolve#522
fix: guard against nil ContextEvaluator func in memprovider Resolve#522somaz94 wants to merge 2 commits into
Conversation
Signed-off-by: somaz <genius5711@gmail.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughModified ChangesContextEvaluator nil guard
Estimated code review effort: 1 (Trivial) | ~5 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #522 +/- ##
==========================================
+ Coverage 86.45% 86.55% +0.09%
==========================================
Files 22 22
Lines 2119 2119
==========================================
+ Hits 1832 1834 +2
+ Misses 242 241 -1
+ Partials 45 44 -1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Signed-off-by: somaz <genius5711@gmail.com>
memprovider.InMemoryFlag.ContextEvaluatoris typed*func(...).Resolveonly checked the pointer for nil, so a non-nil pointer to a nil func passed the
guard and panicked on the dereference-and-call. This adds the missing inner
nil-func check so such a flag falls back to the default variant, plus a
regression test.
Fixes #521
Validation:
make test(go test -tags testtools -race): all packages pass, memprovider at 86.9% coveragemake lint(golangci-lint v2.9.0): 0 issues